﻿using System.Linq;
using AgileDesign.Utilities;
using Xunit;

namespace Utilities.UnitTests
{
    public class GenericExtensionsFacts
    {
        [Fact]
        public void In()
        {
            var range = Enumerable.Range(1, 5).ToArray();

            Assert.True(1.In(range));
            Assert.True(5.In(range));
            Assert.False(0.In(range));
            Assert.False(6.In(range));

            Assert.True(TestEnum.A.In(TestEnum.A, TestEnum.B));
            Assert.False(TestEnum.C.In(TestEnum.A, TestEnum.B));
        }

        enum TestEnum
        {
            A,
            B,
            C
        }
    }
}
